package com.amose.factory;

import java.sql.SQLException;
import java.util.List;

/**
 * @author yangpeng
 * @time 2020/2/22
 * @since 1.0.0
 * 每一个sql会话
 */
public interface SqlSession {

    /**
     * 查询sql
     * @param statementId
     * @param params
     * @param <T>
     * @return
     */
    public <T> List<T> queryList(String statementId, Object... params) throws SQLException, Exception;

    /**
     * 查询sql
     * @param statementId
     * @param params
     * @param <T>
     * @return
     */
    public <T> T queryOne(String statementId,Object... params) throws SQLException, Exception;

    /**
     * 更新sql
     * @param statementId
     * @param params
     * @return
     */
    public int update(String statementId,Object... params) throws Exception;

    /**
     * 获取代理对象
     * @param eClass
     * @param <E>
     * @return
     */
    public <E> E getProxyMapper(Class<?> eClass);
}
